package com.juicygames.framework.action;

import com.juicygames.framework.GameAction;


public class UpdateAction extends GameAction {
	
	private float timeElapsed;
	private float framesPerSecond;
	
	private static UpdateAction instance = null;
	
	public static UpdateAction getInstance(float timeElapsed, float framesPerSecond) {
		if (instance == null) {
			instance = new UpdateAction(timeElapsed, framesPerSecond);
		} else {
			instance.setTimeElapsed(timeElapsed);
			instance.setFramesPerSecond(framesPerSecond);
		}
		return instance;
	}
	
	private UpdateAction(float timeElapsed, float framesPerSecond) {
		this.timeElapsed = timeElapsed;
		this.framesPerSecond = framesPerSecond;
	}
	
	public float getTimeElapsed() {
		return timeElapsed;
	}
	
	public float getFramesPerSecond() {
		return framesPerSecond;
	}

	protected void setTimeElapsed(float timeElapsed) {
		this.timeElapsed = timeElapsed;
	}

	protected void setFramesPerSecond(float framesPerSecond) {
		this.framesPerSecond = framesPerSecond;
	}

}
